@extends('hrs.layouts.app')  
@section('css')
        <!-- Custombox css -->
        <link href="{{asset('hrs/plugins/custombox/css/custombox.css')}}" rel="stylesheet">
  
@endsection         
@section('content')

            <div class="container">
                    @if(session('rs'))
                              <div class="alert alert-{{session('rs')['status']}}">
                                {{ session('rs')['msg'] }}
                              </div>
                    @endif
              
                <div class="row">
                    <div class="col-sm-12">

                        <div class="card-box">
                        <form method="post" action="{{url('/items')}}" id="form1">
                            <div class="row">

                                <div class="col-lg-12">
                       
                            {{ csrf_field()}}    

                                    
                                        <h5 class="text-muted text-uppercase m-t-0 m-b-10"><b>录入单据</b></h5>


                                        <div class="form-group col-md-4">

                                            <label  class="col-md-3">船名<span class="text-danger">*</span></label>
                                            <div class="col-md-9">
                                            <input type="text" class="form-control" placeholder="" name="ship_name" value="{{old('ship_name')}}" required="">
                                        </div>
                                        </div>


                                        <div class="form-group  col-md-4">
                                            <label class="col-md-3">航次<span class="text-danger">*</span></label>

                                            <div class="col-md-9">
                                            <input type="text" class="form-control" placeholder="" name="ship_line" value="{{old('ship_line')}}" required="">
                                        </div>
                                        </div>
                                       

                                       


                                        <div class="form-group  col-md-4">

                                       

                                            <label class="col-md-3">提单号<span class="text-danger">*</span></label>
                                            <div class="col-md-9">
                                            <input type="text" class="form-control" placeholder="" name="code" required="">
                                        </div>
                                        </div>

                                        <div class="form-group  col-md-4">
                                            <label class="col-md-3">箱型20<span class="text-danger">*</span></label>
                                            <div class="col-md-9">
                                            <input type="text" class="form-control" placeholder="" name="box_20">
                                            </div>
                                        </div>
                                        <div class="form-group  col-md-4">
                                            <label class="col-md-3">箱型40<span class="text-danger">*</span></label>
                                            <div class="col-md-9">
                                            <input type="text" class="form-control" placeholder="" name="box_40">
                                            </div>
                                        </div>
                                        <div class="form-group  col-md-12">
                                            <label class="col-md-1">备注</label>
                                            <div class="col-md-11">
                                            <input type="text" class="form-control" placeholder="" name="remark">
                                            </div>
                                        </div>

                                        

                                        

                                       

                                     

                                        

                                      

                                 
                                    
                              

                                    
                                </div>
                                    
                            </div>
                            
                            <hr/>
                            <div class="row">

                                <div class="col-lg-12">
            


                                        <h5 class="text-muted text-uppercase m-t-0 m-b-20"><b>费用信息</b></h5>
        <table class="table" id="fee">
                                            <tr>
                                                <th>费目</th>
                                                <!-- <th>箱型</th>
                                                <th>箱量</th> -->
                                                <th>应收</th>
                                               
                                                <th>应收关系人</th>
                                                <th>应付</th>
                                                
                                                
                                                <th>应付关系人</th>
                                                <th>备注</th>
                                               <th></th>
                                            </tr>
        <tbody class="feeitem">                                    
        <tr>
            <td>
                <input type="text" class="form-control" placeholder="" name="fee_name[]" value="" required="">
            </td>
           <!--  <td><input type="text" class="form-control" placeholder="" name="fee_name[]" value=""></td>
            <td><input type="text" class="form-control" placeholder="" name="fee_name[]" value=""></td> -->
            <td>
                <input type="text" class="form-control" placeholder="" name="receive_money[]" value="">
            </td>
            
            <td>
                <input type="text" class="form-control" placeholder="" name="receive_contacter[]" value="">
            </td>
            <td>
                <input type="text" class="form-control" placeholder="" name="pay_money[]" value="">
            </td>
            
            <td>
                <input type="text" class="form-control" placeholder="" name="pay_contacter[]" value="">
            </td>
            <td>
                <input type="text" class="form-control" placeholder="" name="fee_remark[]" value="">
            </td>
            <td width="100">
                <button type="button" class="btn btn-sm btn-primary btn-add"><i class="md md-add"></i></button>
                <button type="button" class="btn btn-sm btn-danger btn-remove"><i class="md md-remove"></i></button>
            </td>
        </tr>
        </tbody>
    </table>
            <div class="form-group m-b-20 col-md-12">
                 <button type="submit" class="btn w-sm btn-info waves-effect waves-light" id="save">保存费用信息</button>

                                        
                                         
                                         
                                        
                                        

                                    
        
           
                             
   
                                </div>
                                    
                            </div>
                           

  </form> 
                        
                        
                    </div>
                </div>
 </div>
               

            </div> <!-- end container -->
@endsection        

        
@section('js')
  <!-- Modal-Effect -->
    <script src="{{asset('hrs/plugins/custombox/js/custombox.min.js')}}"></script>
    <script src="{{asset('hrs/plugins/custombox/js/legacy.min.js')}}"></script>
    <script src="{{asset('js/sweetalert.min.js')}}"></script>
    <script type="text/javascript">
        $(document).on('click','.btn-add',function(){
            var tr = $('.feeitem tr').eq(0).clone();

            $('#fee').append(tr);
            console.info(tr);
        });
       
        $(document).on('click','.btn-remove',function(){
            $(this).parents('tr').remove();
        })


       

        // $('#save').on('click',function(){           
        //     var url = "{{url('/items')}}";
        //     var data = $('#form1').serialize();
        //     $.post(url,data,function(rs){
        //         swal(rs.msg, "", "info"); 
        //     });
        // });

       

       

    </script>
@endsection

